﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Microsoft.Extensions.DependencyInjection;

namespace Xc.Builds.MasterTools.Views
{
    /// <summary>
    /// MainView.xaml 的交互逻辑
    /// </summary>
    public partial class MainView : UserControl
    {
        private readonly IServiceProvider serviceProvider;

        public MainView(IServiceProvider serviceProvider)
        {
            InitializeComponent();
            this.serviceProvider = serviceProvider;
        }

        private void DotNetAzureNavBarItem_Click(object sender, RoutedEventArgs e)
        { _content.Content = serviceProvider.GetService<Xc.Logics.AepCoap.Views.MainView>(); }

        private void DotNetAzureNavBarItem_Click_1(object sender, RoutedEventArgs e)
        { _content.Content = serviceProvider.GetService<Xc.Logics.OneNet.Views.MasterView>(); }

        private void DotNetAzureNavBarItem_Click_2(object sender, RoutedEventArgs e)
        { _content.Content = serviceProvider.GetService<Xc.Logics.HyperTerminalCore.Tcp.Views.MainView>(); }

        private void DotNetAzureNavBarItem_Click_3(object sender, RoutedEventArgs e)
        { _content.Content = serviceProvider.GetService<Xc.Logics.HyperTerminalCore.Udp.Views.MainView>(); }

        private void DotNetAzureNavBarItem_Click_4(object sender, RoutedEventArgs e)
        {
            _content.Content = new DigitalSelectView();
        }
    }
}
